package edu.hda.pt.server;

import edu.hda.pt.utils.TestObject;

/**
 * PTServer is the super-class for the server. 
 * 
 * @author Marc Hammerton
 * 
 */
public abstract class PTServer {
	
	/**
	 * The ID of the server
	 */
	public String serverID;

	// Server methods
	
	/**
	 * Method for starting the server
	 */
	public abstract void start();

	/**
	 * Method for stopping the server
	 */
	public abstract void stop();

	
	// Performance test methods
	
	/**
	 * Method for handling String values
	 * 
	 * @param testString - String value to be handled on the server
	 * @return The String value to be sent back to the client
	 */
	public String handleString(String testString) {

		return testString;
	}

	/**
	 * Method for handling Integer values
	 * 
	 * @param testInt - Integer value to be handled on the server
	 * @return The Integer value to be sent back to the client
	 */
	public int handleInteger(int testInt) {

		return testInt;
	}

	/**
	 * Method for handling Long values
	 * 
	 * @param testLong - Long value to be handled on the server
	 * @return The Long value to be sent back to the client
	 */
	public long handleLong(long testLong) {
		
		return testLong;
	}

	/**
	 * Method for handling Boolean values
	 * 
	 * @param testBool - Boolean value to be handled on the server
	 * @return The Boolean value to be sent back to the client
	 */
	public boolean handleBool(boolean testBool) {
		
		return testBool;
	}

	/**
	 * Method for handling an object
	 * 
	 * @param testObject - Object to be handled on the server
	 * @return The object to be sent back to the client
	 */
	public TestObject handleObject(TestObject testObject) {
		
		return testObject;
	}

	/**
	 * Method for handling Byte values
	 * 
	 * @param testBytes - The Byte values to be handled on the server
	 * @return - The Byte values to be sent back to the client
	 */
	public byte[] handleBytes(byte[] testBytes) {
		
		return testBytes;
	}

}
